package luigibros.window;

import java.awt.Image;
import java.awt.image.ImageObserver;
import java.util.Random;

public class Winner extends Ghost {
	protected int d;
	private boolean isX;
	private boolean forward;
	private Craft craft;
	public Winner(Image i, ImageObserver obs, Craft c) {
		super(i, obs, c);
		d = 5;
		x = 500;
		y = 300;
		craft = c;
	}
	
	public void move() {
		if(r.nextGaussian() < -.75)
			isX = !isX;
		if(r.nextGaussian() < -.75)
			forward = !forward;
		if(forward) {
			if(isX)
				x += d;
			else
				y += d;
		} else {
			if(isX)
				x -= d;
			else
				y -= d;
		}
		/*if(Math.abs(craft.getX() - this.getX()) <= 50  && Math.abs(craft.getY() - this.getY()) <= 50)
    		starCount++;*/
	}

	
	public void jump() {
		x = (int) (150 * r.nextGaussian()) + 200;
		y = (int) (200 * r.nextGaussian()) + 400;
	}
}
